
package com.nd.rj.common.login.DataDef;

import android.content.Context;

import com.nd.rj.common.login.NdLoginplatform;
import com.nd.rj.common.login.atomoperation.OperUserInfo;
import com.product.android.business.bean.UserInfo;

public class NdLoginConst {
	
	private static UserInfo curUser;

	/**
	 * 有些地方取不到context，所以就增加这个接口
	 * @param type
	 * @return
	 */
	public static UserInfo getUserInfo(int type) {
		if (curUser == null) {
			curUser = OperUserInfo.getInstance().GetLastUserInfo();
		}
		return curUser;
	}
	
	public static UserInfo getUserInfo(int type, Context ctx) {
		if (curUser == null) {
			curUser = NdLoginplatform.getInstance(type).getLastUserInfo(ctx);
		}
		return curUser;
	}

	public static void setUserInfo(UserInfo info) {
		curUser = info;
		if(info != null)
		    OperUserInfo.getInstance().SetUserInfo(info);
	}
	
    public static final String USER = "USER";

    public static final String LOGIN_TYPE = "LOGIN_TYPE";

    public static final String FROM = "FROM";

    public static final String USERNAME = "USERNAME";

    public static final String PASSWORD = "PASSWORD";
    
    public static final String CAN_SWITCH_USER = "CAN_SWITCH_USER";
    
    public static final String LOCAL_SWITCH_USER = "LOCAL_SWITCH_USER";

    public static final int REGIST = 100;
    
    public static final int REGIST_MOBILE = 101;
    
    public static final int REGIST_MOBILE_SEND_CODE = 102;

    public static final int LOGIN_TYPE_UAP = 0;

    public static final int LOGIN_TYPE_OAP = 1;
    
    //modify by chenqsh 2014-1-2
    public static final String URL_FORGET_PHONE = "https://reg.uap.99.com/uaplogin/forget/phone?appid=213&style=teens&returnurl=http://reg.uap.99.com/uaplogin/ucenter";
    
    public static final String URL_FORGET_MAIL = "https://reg.uap.99.com/uaplogin/forget/email?appid=213&style=teens&returnurl=http://reg.uap.99.com/uaplogin/ucenter";
    
//    public static final String URL_FORGET_PHONE = "https://reg.uap.91.com/uaplogin/forget/phone?appid=98&returnurl=http://todo.91.com/";
//    
//    public static final String URL_FORGET_MAIL = "https://reg.uap.91.com/uaplogin/forget/email?appid=98&returnurl=http://todo.91.com/";
    
    public static final String CLAUSE = "https://reg.99.com/WebStaticPage/xieyi.html";

    // rsa加密
    public static final String MODULUS = "ECBC644F598318E42CA7ED92497BFB8019D4C166B62A60D0E83E73321FC6CE8596421F981545CAF93EE8231CA4D544BEBF0A6AEA3F9305A6ED675C96A4CA87A9";

    public static final String PUBEXP = "10001";
    
    //手机注册时用到的参数
    public static final String MOBILE_TYPE = "4";
    
    //手机注册时的验证码类型
    public static final int REGISTER_CODE_TYPE = 4;
    
    //手机注册时的注册类型
    public static final int REGISTER_TYPE_MOBILE = 1;
}
